package com.king.modules.monitor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.king.framework.base.service.impl.YyBaseServiceImpl;
import com.king.modules.monitor.domain.SysLoginLogEntity;
import com.king.modules.monitor.mapper.SysLoginLogMapper;
import com.king.modules.monitor.service.SysLoginLogService;

/**
 * 系统访问日志情况信息 服务层处理
 * 
 * @author king
 */
@Service
public class SysLoginLogServiceImpl  extends YyBaseServiceImpl<SysLoginLogMapper, SysLoginLogEntity, Long> implements SysLoginLogService {

	@Autowired
	private SysLoginLogMapper loginlogMapper;

	/**
	 * 新增系统登录日志
	 * 
	 * @param loginlog
	 *            访问日志对象
	 */
	@Transactional
	@Override
	public void insertLoginlog(SysLoginLogEntity loginlog) {
		loginlogMapper.insertLoginlog(loginlog);
	}

	/**
	 * 查询系统登录日志集合
	 * 
	 * @param loginlog
	 *            访问日志对象
	 * @return 登录记录集合
	 */
	@Override
	public List<SysLoginLogEntity> selectLoginlogList(SysLoginLogEntity loginlog) {
		return loginlogMapper.selectLoginlogList(loginlog);
	}

	/**
	 * 批量删除系统登录日志
	 * 
	 * @param infoIds
	 *            需要删除的登录日志ID
	 * @return 结果
	 */
	@Transactional
	@Override
	public int deleteLoginlogByIds(Long[] infoIds) {
		return loginlogMapper.deleteLoginlogByIds(infoIds);
	}

	/**
	 * 清空系统登录日志
	 */
	@Transactional
	@Override
	public void cleanLoginlog() {
		loginlogMapper.cleanLoginlog();
	}
}
